def fibonacciSum(n):

    if not isinstance(n, int) or n <= 0:
        raise ValueError("n必须是正整数！")
    
    if n == 1:
        return 1  
    elif n == 2:
        return 1 + 1  
    
    a, b = 1, 1
    sum_total = a + b  
    
    for _ in range(3, n + 1):
        c = a + b  
        sum_total += c  
        a, b = b, c  
    
    return sum_total

# print(f"第20个数（F(20)）：{fibonacciNum(20)}")